abd48c283c8bc8f96eb250ab1424f686918a854d,fcrepo-http-api/src/main/java/org/fcrepo/http/api/ContentExposingResource.java,ContentExposingResource,addCacheControlHeaders,#HttpServletResponse#FedoraResource#Session#,501

Before Change



        // See note about this code in the javadoc above.
        if (resource instanceof NonRdfSourceDescription) {
            final NonRdfSourceDescription description = (NonRdfSourceDescription)resource;
            // Use a weak ETag for the LDP-RS
            etag = new EntityTag(description.getDescribedResource().getEtagValue(), true);
            date = description.getDescribedResource().getLastModifiedDate();
        } else if (resource instanceof FedoraBinary) {
            final NonRdfSource binary = (NonRdfSource)resource;

After Change


     * @param session the session
     */
    protected static void addCacheControlHeaders(final HttpServletResponse servletResponse,
                                                 final FedoraResource resource,
                                                 final Session session) {

        final String txId = TransactionServiceImpl.getCurrentTransactionId(session);
        if (txId != null) {
            // Do not add caching headers if in a transaction
            return;
        }

        final EntityTag etag;
        final Date date;

        // See note about this code in the javadoc above.
        if (resource instanceof FedoraBinary) {
            // Use a strong ETag for LDP-NR
            etag = new EntityTag(resource.getDescription().getEtagValue());
            date = resource.getDescription().getLastModifiedDate();
        } else {
            // Use a weak ETag for the LDP-RS
            etag = new EntityTag(resource.getDescribedResource().getEtagValue(), true);
            date = resource.getDescribedResource().getLastModifiedDate();
        }